package com.scalar.chiptrack.users.notification.forms;

import com.scalar.chiptrack.ChipTrackActionForm;
import com.scalar.chiptrack.users.notification.Notification;
import java.util.ArrayList;
import org.apache.struts.action.ActionMapping;
import javax.servlet.http.HttpServletRequest;


public class NotificationForm extends ChipTrackActionForm
{
    private String userId;
    private String emailId;
    private ArrayList vendors;
    private ArrayList selectedNotifications;

    public String getUserId()
    {
        return userId;
    }

    public void setUserId( String userId )
    {
        this.userId = userId;
    }

    public String getEmailId() {
        return emailId;
    }

    public void setEmailId(String emailId) {
        this.emailId = emailId;
    }

    public ArrayList getVendors() {
        return vendors;
    }

    public void setVendors(ArrayList vendors) {
        this.vendors = vendors;
    }

    public ArrayList getSelectedNotifications() {
        return selectedNotifications;
    }

    public void setSelectedNotifications(ArrayList selectedNotifications) {
        this.selectedNotifications = selectedNotifications;
    }

    public void reset( ActionMapping mapping, HttpServletRequest request )
    {
        if( vendors != null )
        {
            for ( int i = 0; i < vendors.size(); i++ )
            {
                Notification notification = ( Notification ) vendors.get(i);
                notification.setSelected( false );
            }
        }
        if( selectedNotifications != null )
        {
            for ( int i = 0; i < selectedNotifications.size(); i++ )
            {
                Notification notification = ( Notification ) selectedNotifications.get(i);
                notification.setSelected( false );
            }
        }
    }
}
